<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center classify_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-center flex-sub classify_fd0_0'>
					<text class='classify_fd0_0_c0'>分类</text>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<benben-goods-classify-swiper class='flex' :top='88' :handle-id.sync='click_aid' :lists='dataList'
				@refresh="queryListFunc()" @handle-item="jumpFunc()" @handle-swiper="goPageFunc($event)">
			</benben-goods-classify-swiper>


		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"dataList": [],
				"msgNum": {
					"order_num": "",
					"sys_num": "",
					"no_read_num": "",
					"new_order_message": "",
					"new_sys": "",
					"order_time": "",
					"sys_time": ""
				},
				"click_aid": ""
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
			isLogin() {
				return this.$store.state.token == '' ? false : true;
			}
		},
		watch: {},
		onLoad(options) {

		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.queryListFunc()
			this.getNoReadNumFuncFunc()
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取未读消息数量
			async getNoReadNumFuncFunc() {
				if (this.isLogin === true) {
					//请求方法
					//数据验证

					let datamsgNum = await this.$api.get(global.apiUrls.post64140908ca17c, {

					});

					if (datamsgNum.data.code != 1) {
						this.$message.info(datamsgNum.data.msg);
						return
					}
					let infomsgNum = datamsgNum.data;
					this.msgNum = infomsgNum.data
					uni.setTabBarBadge({
						index: 4,
						text: this.msgNum.no_read_num
					})
				}
			},
			//获取服务分类
			async queryListFunc() {
				//请求方法
				//数据验证

				let datadataList = await this.$api.get(global.apiUrls.post63e4bbbda555d, {

				});

				if (datadataList.data.code != 1) {
					this.$message.info(datadataList.data.msg);
					return
				}
				let infodataList = datadataList.data;
				this.dataList = infodataList.data

			},
			//跳转
			jumpFunc() {
				this.$urouter.navigateTo(`/pages/index/serviceClassification/serviceClassification?aid=${this.click_aid}`);
			},
			//动态跳转
			goPageFunc(e) {
				this.dynamicJump(e.href);
			},

		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto;
	}

	.classify_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.classify_fd0_0_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
	}

	.classify_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}
</style>